home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Demos / AppMaker™ 1.5 DEMO / Demo AppMaker™ / Demo AppMaker™.rsrc / TmCT_102_App < prev    next >
Encoding:
Text File  |  1992-04-08  |  1.9 KB  |  79 lines

  1. /* %filename% -- application methods */
  2. /* Created %date% %time% by AppMaker */
  3.  
  4. /*    This module overrides the AppMaker-generated code in z%Appname%App.%    %*/
  5. /*    It provides a place for you to add your own code and still be able to    */
  6. /*    generate code for new changes to the user interface.  This module will    */
  7. /*    not be regenerated by AppMaker unless you delete it.  Its superclass,    */
  8. /*    z%Appname%App, may be regenerated to handle user interface changes%        %*/
  9. /*    without losing your hand-coded changes to this module.                    */
  10.  
  11. #include <Commands.h>
  12. #include <CBartender.h>
  13. #include <CWindow.h>
  14. #include <Global.h>
  15. #include "ResourceDefs.h"
  16. %for each menu gen includeAppDialogs%
  17. #include "%Appname%Data.h"
  18. #include "%Appname%App.h"
  19.  
  20. extern    OSType         gSignature;
  21. extern    CBartender    *gBartender;
  22.  
  23. /*----------*/
  24. void    C%Appname%App::I%Appname%App    (void)
  25. {
  26.     inherited::I%Appname%App ();
  27.  
  28.     // your application-specific initialization:
  29.  
  30. } /* I%Appname%App */
  31.  
  32. /*----------*/
  33. void    C%Appname%App::SetUpFileParameters    (void)
  34. {
  35.     inherited::SetUpFileParameters ();
  36.     sfNumTypes = 1;
  37.     sfFileTypes [0] = kFileType;
  38.     gSignature = kSignature;
  39.  
  40. } /* SetUpFileParameters */
  41.  
  42. /*----------*/
  43. void    C%Appname%App::UpdateMenus        (void)
  44. {
  45.     inherited::UpdateMenus ();
  46.     %for each menu gen updateAppMenus%
  47.  
  48. } /* UpdateMenus */
  49.  
  50. /*----------*/
  51. void    C%Appname%App::DoCommand (long        theCommand)
  52. {
  53.     short        theMenu;
  54.     short        theItem;
  55.     Str255        theItemText;
  56.  
  57.     if (theCommand < 0) {                /* menu generated dynamically */
  58.         theMenu = HiShort (-theCommand);
  59.         if (theMenu == MENUapple) {
  60.             inherited::DoCommand (theCommand);    /* handle Apple menu in superclass */
  61.         } else {
  62.             theItem = LoShort (-theCommand);
  63.             GetItem (GetMHandle (theMenu), theItem, theItemText);
  64.             /* do the right thing with the text of the item */
  65.         }
  66.     } else {
  67.         switch (theCommand) {
  68.             %for each menu gen handleAppItems%
  69.  
  70.             default:
  71.                     inherited::DoCommand (theCommand);
  72.                 break;
  73.         } /* switch */
  74.     }
  75.  
  76. } /* DoCommand */
  77.  
  78. /* %filename% */
  79.